package com.wc;

import com.dexcoder.ws.GetCountryRequest;
import com.dexcoder.ws.GetCountryResponse;
import org.springframework.ws.client.core.support.WebServiceGatewaySupport;

/**
 * @author yale
 * @date 2017/10/20
 * @version 2.0
 */
public class WsClient extends WebServiceGatewaySupport {
    public GetCountryResponse getCountry(String name) {
        GetCountryRequest request = new GetCountryRequest();
        request.setName(name);
        GetCountryResponse response = (GetCountryResponse) getWebServiceTemplate().marshalSendAndReceive(
                "http://localhost:1001/ws/countries.wsdl", request);
        return response;
    }
}
